
namespace PureRobot.Digi.ConnectME.JumpStart.LightFun
{
    using System;
    using System.Collections;
    using System.Net;
    using System.Net.Sockets;
    using System.Runtime.CompilerServices;
    using System.Text;
    using System.Threading;
    using Microsoft.SPOT;
    using Microsoft.SPOT.Hardware;
    using Microsoft.SPOT.Net;
    using Microsoft.SPOT.Net.NetworkInformation;


    /// <summary>
    /// Main entry point container class for the application.
    /// </summary>
    public class Start
    {
        /// <summary>
        /// Main entry point for the application.
        /// </summary>
        public static void Main()
        {
            using (Lights lights = new Lights())
            {
                //Simple on and off
                DateTime complete = DateTime.Now.AddSeconds(5);
                while (DateTime.Now < complete)
                {
                    lights.SwitchOn(Lights.Led.One);
                    Thread.Sleep(200);
                    lights.SwitchOff(Lights.Led.One);
                    Thread.Sleep(200);
                }

                //All on and off 
                complete = DateTime.Now.AddSeconds(5);
                while (DateTime.Now < complete)
                {
                    lights.SwitchAllOn();
                    Thread.Sleep(200);
                    lights.SwitchAllOff();
                    Thread.Sleep(200);
                }

                //Knight rider sequence
                complete = DateTime.Now.AddSeconds(5);
                while (DateTime.Now < complete)
                {
                    lights.Sweep(50, Lights.SweepDirection.Right);
                    lights.Sweep(50, Lights.SweepDirection.Left);
                    Thread.Sleep(500);
                }
            }
        }

    }
}
